/**
 *====================================================
* 文件名称: PickupInventoryBulstockServiceImpl.java
 * 修订记录：
  * No    日期				作者(操作:具体内容)
  * 1.    2016年01月05日	chenxy(创建:创建文件)
  *====================================================
  * 类描述：(说明未实现或其它不应生成javadoc的内容)
  */
package com.yuexunit.finance.project.service;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.yuexunit.finance.project.entity.PickupInventoryBulstockEntity;
import com.yuexunit.inject.annotation.Implements;
import com.yuexunit.persist.PersistUtil;

/**
 * @ClassName: PickupInventoryBulstockServiceImpl
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author chenxy
 * @date 2016年01月05日 10:00:54
 */
@Implements(PickupInventoryBulstockService.class)
public class PickupInventoryBulstockServiceImpl implements PickupInventoryBulstockService {

	@Override
	public Long createPickupInventoryBulstock(PickupInventoryBulstockEntity entity) {
		PersistUtil.insert(entity);
		return entity.getPickupInventoryBulstockId();
	}

	@Override
	public void renovatePickupInventoryBulstock(PickupInventoryBulstockEntity persist) {
		PersistUtil.update(persist);
	}

	@Override
	public void deletePickupInventoryBulstock(Long pickupInventoryBulstockId) {
		PersistUtil.delete(PickupInventoryBulstockEntity.class, pickupInventoryBulstockId);
	}

	@Override
	public List<PickupInventoryBulstockEntity> inquirePickupContainerBulstockList(Long pickupId, Long inventoryId) {
		DetachedCriteria criteria = DetachedCriteria.forClass(PickupInventoryBulstockEntity.class);
		criteria.add(Restrictions.eq("pickupId", pickupId));
		criteria.add(Restrictions.eq("inventoryId", inventoryId));
		return PersistUtil.get(criteria);
	}

	@Override
	public List<PickupInventoryBulstockEntity> inquirePickupInventoryBulstockList(Long pickupInventoryId) {
		DetachedCriteria criteria = DetachedCriteria.forClass(PickupInventoryBulstockEntity.class);
		criteria.add(Restrictions.eq("pickupInventoryId", pickupInventoryId));
		return PersistUtil.get(criteria);
	}

	@Override
	public List<PickupInventoryBulstockEntity> inquirePickupBulstockList(Long pickupId) {
		DetachedCriteria criteria = DetachedCriteria.forClass(PickupInventoryBulstockEntity.class);
		criteria.add(Restrictions.eq("pickupId", pickupId));
		return PersistUtil.get(criteria);
	}

}
